package com.example.everying.model.entity.pay;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @program: everything
 * @description: 支付订单表
 * @author: szy
 * @create: 2025-05-14 16:45
 **/
@Data
@TableName("payment_order")
public class PaymentOrderEntity implements Serializable {

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @ApiModelProperty(value = "主键ID")
    private Long id;

    @NotBlank(message = "用户ID不能为空")
    @ApiModelProperty(value = "用户ID")
    private String userId;

    @NotBlank(message = "商户订单号不能为空")
    @ApiModelProperty(value = "商户订单号")
    private String outTradeNo;

    @ApiModelProperty(value = "微信支付订单号")
    private String transactionId;

    //    @NotBlank(message = "交易类型不能为空")
    @ApiModelProperty(value = "交易类型")
    private String tradeType;

    @ApiModelProperty(value = "用户标识")
    private String openid;

    @NotNull(message = "订单总金额不能为空")
    @ApiModelProperty(value = "订单总金额(分)")
    private BigDecimal totalFee;

    @ApiModelProperty(value = "应结订单金额(分)")
    private BigDecimal settlementTotalFee;

    @NotBlank(message = "商品描述不能为空")
    @ApiModelProperty(value = "商品描述")
    private String body;

    @ApiModelProperty(value = "商品详情")
    private String detail;

    @ApiModelProperty(value = "附加数据")
    private String attach;

    @ApiModelProperty(value = "交易起始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime timeStart;

    @ApiModelProperty(value = "交易结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime timeExpire;

    @ApiModelProperty(value = "支付完成时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime timeEnd;

    @ApiModelProperty(value = "交易状态")
    private String tradeState;

    @ApiModelProperty(value = "交易状态描述")
    private String tradeStateDesc;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
}
